/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.meteocal.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Alex
 */
@Embeddable
public class InvitationPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDU")
    private int idu;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDE")
    private int ide;

    public InvitationPK() {
    }

    public InvitationPK(int idu, int ide) {
        this.idu = idu;
        this.ide = ide;
    }

    public int getIdu() {
        return idu;
    }

    public void setIdu(int idu) {
        this.idu = idu;
    }

    public int getIde() {
        return ide;
    }

    public void setIde(int ide) {
        this.ide = ide;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idu;
        hash += (int) ide;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InvitationPK)) {
            return false;
        }
        InvitationPK other = (InvitationPK) object;
        if (this.idu != other.idu) {
            return false;
        }
        if (this.ide != other.ide) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.meteocal.entities.InvitationPK[ idu=" + idu + ", ide=" + ide + " ]";
    }
    
}
